\hypertarget{classduye_1_1_mutex}{\section{duye\-:\-:Mutex Class Reference}
\label{classduye_1_1_mutex}\index{duye\-::\-Mutex@{duye\-::\-Mutex}}
}


P\-O\-S\-I\-X mutex wrapper.  




{\ttfamily \#include $<$duye\-\_\-lock.\-h$>$}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classduye_1_1_mutex_aef867f725b38f5cd0f5765af958b9a2b}{Mutex} ()
\begin{DoxyCompactList}\small\item\em constructor \end{DoxyCompactList}\item 
\hyperlink{classduye_1_1_mutex_a99eab7355fdac23a1b4d698063203561}{Mutex} (const int32 kind)
\begin{DoxyCompactList}\small\item\em constructor \end{DoxyCompactList}\item 
bool \hyperlink{classduye_1_1_mutex_ac17003e13b78c554a7063b9a1664fb37}{lock} ()
\begin{DoxyCompactList}\small\item\em lock mutex, enter to awaited state \end{DoxyCompactList}\item 
bool \hyperlink{classduye_1_1_mutex_a3326d59dce4b63c65450eb13034f8ae3}{try\-Lock} ()
\begin{DoxyCompactList}\small\item\em try to lock mutex, failure return immediately \end{DoxyCompactList}\item 
bool \hyperlink{classduye_1_1_mutex_a29550dc24a3f0f4e70067b8d50021b6d}{unlock} ()
\begin{DoxyCompactList}\small\item\em release lock \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
P\-O\-S\-I\-X mutex wrapper. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classduye_1_1_mutex_aef867f725b38f5cd0f5765af958b9a2b}{\index{duye\-::\-Mutex@{duye\-::\-Mutex}!Mutex@{Mutex}}
\index{Mutex@{Mutex}!duye::Mutex@{duye\-::\-Mutex}}
\subsubsection[{Mutex}]{\setlength{\rightskip}{0pt plus 5cm}duye\-::\-Mutex\-::\-Mutex (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{classduye_1_1_mutex_aef867f725b38f5cd0f5765af958b9a2b}


constructor 

\begin{DoxyNote}{Note}
default mutex type is P\-T\-H\-R\-E\-A\-D\-\_\-\-M\-U\-T\-E\-X\-\_\-\-R\-E\-C\-U\-R\-S\-I\-V\-E 
\end{DoxyNote}
\hypertarget{classduye_1_1_mutex_a99eab7355fdac23a1b4d698063203561}{\index{duye\-::\-Mutex@{duye\-::\-Mutex}!Mutex@{Mutex}}
\index{Mutex@{Mutex}!duye::Mutex@{duye\-::\-Mutex}}
\subsubsection[{Mutex}]{\setlength{\rightskip}{0pt plus 5cm}duye\-::\-Mutex\-::\-Mutex (
\begin{DoxyParamCaption}
\item[{const int32}]{kind}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [explicit]}}}\label{classduye_1_1_mutex_a99eab7355fdac23a1b4d698063203561}


constructor 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em kind} & \-: mutex type \\
\hline
\end{DoxyParams}
\begin{DoxyNote}{Note}
have four mutex type, are P\-T\-H\-R\-E\-A\-D\-\_\-\-M\-U\-T\-E\-X\-\_\-\-N\-O\-R\-M\-A\-L P\-T\-H\-R\-E\-A\-D\-\_\-\-M\-U\-T\-E\-X\-\_\-\-R\-E\-C\-U\-R\-S\-I\-V\-E P\-T\-H\-R\-E\-A\-D\-\_\-mutex\-\_\-\-E\-R\-R\-O\-R\-C\-H\-E\-C\-K P\-T\-H\-R\-E\-A\-D\-\_\-\-M\-U\-T\-E\-X\-\_\-\-D\-E\-F\-A\-U\-L\-T 
\end{DoxyNote}


\subsection{Member Function Documentation}
\hypertarget{classduye_1_1_mutex_ac17003e13b78c554a7063b9a1664fb37}{\index{duye\-::\-Mutex@{duye\-::\-Mutex}!lock@{lock}}
\index{lock@{lock}!duye::Mutex@{duye\-::\-Mutex}}
\subsubsection[{lock}]{\setlength{\rightskip}{0pt plus 5cm}bool duye\-::\-Mutex\-::lock (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{classduye_1_1_mutex_ac17003e13b78c554a7063b9a1664fb37}


lock mutex, enter to awaited state 

\begin{DoxyReturn}{Returns}
true/false 
\end{DoxyReturn}
\begin{DoxyNote}{Note}

\end{DoxyNote}
\hypertarget{classduye_1_1_mutex_a3326d59dce4b63c65450eb13034f8ae3}{\index{duye\-::\-Mutex@{duye\-::\-Mutex}!try\-Lock@{try\-Lock}}
\index{try\-Lock@{try\-Lock}!duye::Mutex@{duye\-::\-Mutex}}
\subsubsection[{try\-Lock}]{\setlength{\rightskip}{0pt plus 5cm}bool duye\-::\-Mutex\-::try\-Lock (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{classduye_1_1_mutex_a3326d59dce4b63c65450eb13034f8ae3}


try to lock mutex, failure return immediately 

\begin{DoxyReturn}{Returns}
true/false 
\end{DoxyReturn}
\begin{DoxyNote}{Note}

\end{DoxyNote}
\hypertarget{classduye_1_1_mutex_a29550dc24a3f0f4e70067b8d50021b6d}{\index{duye\-::\-Mutex@{duye\-::\-Mutex}!unlock@{unlock}}
\index{unlock@{unlock}!duye::Mutex@{duye\-::\-Mutex}}
\subsubsection[{unlock}]{\setlength{\rightskip}{0pt plus 5cm}bool duye\-::\-Mutex\-::unlock (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{classduye_1_1_mutex_a29550dc24a3f0f4e70067b8d50021b6d}


release lock 

\begin{DoxyReturn}{Returns}
true/false 
\end{DoxyReturn}
\begin{DoxyNote}{Note}

\end{DoxyNote}


The documentation for this class was generated from the following file\-:\begin{DoxyCompactItemize}
\item 
Z\-:/duye/src/duyebase/system/\hyperlink{duye__lock_8h}{duye\-\_\-lock.\-h}\end{DoxyCompactItemize}
